﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[spObtenComboDoctor](
	@pnIdLaboratorio INT
)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	SELECT	d.IdDoctor, d.Nombre
	INTO	#tblDocs
	FROM	dbo.CatDoctor (NOLOCK) d
	WHERE	d.IdLaboratorio = @pnIdLaboratorio
	ORDER BY Nombre;
	
	SELECT	0 as IdDoctor, 'A quien corresponda' as Nombre
	UNION ALL
	SELECT	IdDoctor, Nombre
	FROM	#tblDocs
	
	SET NOCOUNT OFF;
END